<form id="pagerForm" method="post" action="{:U(MODULE_NAME.'/'.CONTROLLER_NAME.'/allotin/')}">
	<input type="hidden" name="pageNum" value="{$currentPage|default='1'}" />
	<input type="hidden" name="numPerPage" value="{$numPerPage}" />
	<input type="hidden" name="_order" value="{$_REQUEST._order}"/>
	<input type="hidden" name="_sort" value="{$_REQUEST._sort}"/>
	<input type="hidden" name="search_where[sequence][like]" value="{$_REQUEST.search_where.sequence.like}"/>
	<input type="hidden" name="search_where[supplier_id][eq]" value="{$_REQUEST.search_where.supplier_id.eq}"/>
	<input type="hidden" name="search_where[depot_id][eq]" value="{$_REQUEST.search_where.depot_id.eq}"/>
	<input type="hidden" name="search_where[new_depot_id][eq]" value="{$_REQUEST.search_where.new_depot_id.eq}"/>
	<input type="hidden" name="search_where[date][and][gt_date]" value="{$_REQUEST.search_where.date.and.gt_date}"/>
	<input type="hidden" name="search_where[date][and][lt_date]" value="{$_REQUEST.search_where.date.and.lt_date}"/>
	<input type="hidden" name="search_where[type][eq]" value="{$_REQUEST.search_where.type.eq}"/>
	<input type="hidden" name="search_where[goods_id][eq]" value="{$_REQUEST.search_where.goods_id.eq}"/>
	<input type="hidden" name="search_where[goods_name][eq]" value="{$_REQUEST.search_where.goods_name.eq}"/>
</form>
<div class="page">
	<div class="pageHeader">
		<form onsubmit="return navTabSearch(this);" action="{:U(MODULE_NAME.'/'.CONTROLLER_NAME.'/'.ACTION_NAME.'/')}" method="post">
			<table class="searchContent" width="100%" style="align:left;">
				<tr>
		        	<td width="6%" align="right">调拨物料：</td>
		        	<td width="17%" align="left">
			        	<input id="goods.id" name="search_where[goods_id][eq]" value="{$search_where.goods_id.eq}" type="hidden"/>
			        	<input type="text" id="goods.name" name="search_where[goods_name][eq]" lookupGroup="goods" value="{$search_where.goods_name.eq}" size="33" readonly="readonly" />
			        </td>
			        <td width="3%">
			        	<a class="btnLook" lookupGroup="goods" href="{:U(MODULE_NAME.'/Goods/lookup')}" ></a>
		    		</td>
		    		<td width="6%" align="right">调拨编码：</td>
		    		<td width="10%" align="left">
						<input type="text" name="search_where[sequence][like]" size="20" minlength="4" maxlength="20" value="{$search_where.sequence.like}"/>
 					</td>
 					<td width="6%" align="right">供应商：</td>
 					<td width="10%" align="left">
						<select class="combox" name="search_where[supplier_id][eq]">
							<option value="">请选择</option>
							<foreach name='supplier' item='v'>
								<option value="{$v['id']}" <eq name="_REQUEST.search_where.supplier_id.eq" value="$v['id']">selected=selected</eq>>{$v['name']}</option>
							</foreach>
						</select>
					</td>	
					<td width="6%" align="right">调出库房：</td>
					<td width="10%" align="right">
	 					<select class="combox" name="search_where[depot_id][eq]">
							<option value="">请选择</option>
							<foreach name='depotAll' item='v'>
								<option value="{$v['id']}" <eq name="_REQUEST.search_where.depot_id.eq" value="$v['id']">selected=selected</eq>>{$v['name']}</option>
							</foreach>
						</select>		
					</td>
					<td width="6%" align="right">调入库房：</td>
					<td width="10%" align="right">
	 					<select class="combox" name="search_where[new_depot_id][eq]">
							<option value="">请选择</option>
							<foreach name='depot' item='v'>
								<option value="{$v['id']}" <eq name="_REQUEST.search_where.new_depot_id.eq" value="$v['id']">selected=selected</eq>>{$v['name']}</option>
							</foreach>
						</select>		
					</td>
					<td width="10%"></td>
				</tr>
			</table>
			<div class="divider"></div>
			<table class="searchContent" width="100%" style="align:left;">
				<tr>
					<td width="6%" align="right">调拨时间：</td>
					<td width="9%">
						<input type="text" maxdate="2020-03-13" mindate="2016-03-02" datefmt="yyyy-MM-dd" class="date textInput readonly valid" name="search_where[date][and][gt_date]" readonly="readonly"  size="13" value="{$search_where.date.and.gt_date}"/>
					</td>						
					<td style="align:center;" width="2%">至</td>
					<td width="9%"><input type="text" maxdate="2020-03-13" mindate="2016-03-02" datefmt="yyyy-MM-dd" class="date textInput readonly valid" name="search_where[date][and][lt_date]" readonly="readonly" size="13" value="{$search_where.date.and.lt_date}"/>
					</td>
					<td width="6%" align="right">状态：</td>
					<td width="10%" align="left">
						<select class="combox" name="search_where[type][eq]">
							<option value="">请选择</option>
							<option value="0" <eq name="_REQUEST.search_where.type.eq" value="0">selected=selected</eq>>拒绝</option>
							<option value="1" <eq name="_REQUEST.search_where.type.eq" value="1">selected=selected</eq>>正常</option>
							<option value="2" <eq name="_REQUEST.search_where.type.eq" value="2">selected=selected</eq>>接收</option>
						</select>
					</td>
					<td width="6%"></td>
					<td align="right" width="10%">
						<div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div></li>
					</td>
					<td width="51%"></td>
		    	</tr>
			</table>
		</form>
	</div>
	<div class="pageContent">
		<div class="panelBar">
			<ul class="toolBar">
				<in name="allot_addId" value="$Think.session.rules">
					<li><a class="add" href="{:U(MODULE_NAME.'/'.CONTROLLER_NAME.'/add')}" target="navTab" rel="allotAdd" title="库存调拨"><span>新增调拨</span></a></li>
				</in><in name="allot_refuseId" value="$Think.session.rules">
 					<li><a title="确实要删除这条调入记录吗?" target="ajaxTodo" href="{:U(MODULE_NAME.'/'.CONTROLLER_NAME.'/refuse','','')}/id/{sid_goods}/navTabId/allotIn" class="delete"><span>拒绝调入</span></a></li>
 				</in><in name="allot_allRefuseId" value="$Think.session.rules">
					<li><a title="确实要拒绝这些调入记录吗?" target="selectedTodo" rel="ids" postType="string" href="{:U(MODULE_NAME.'/'.CONTROLLER_NAME.'/allRefuse','','')}/id/{sid_goods}/navTabId/allotIn" class="delete"><span>全部拒绝</span></a></li>
 					<li class="line">line</li>
				</in>
				<!--<li><a class="edit" href="{:U(MODULE_NAME.'/'.CONTROLLER_NAME.'/edit','','')}/id/{sid_goods}" target="dialog"  mask="true" warn="请选择一条记录"><span>全部接受</span></a></li>-->
			</ul>
		</div>
		<table class="table" width="100%" layoutH="145">
			<thead>
				<tr>
					<th width="22"><input type="checkbox" group="ids" class="checkboxCtrl"></th>
					<th width="120">调拨编码</th>
					<th width="80">调拨时间</th>
					<th>原物料编码</th>
					<th>新物料编码</th>				
					<th>物料名称</th>
					<th>物料型号</th>
					<th>物料规格</th>
					<th width="40">单位</th>
					<th>数量</th>
					<th>价格</th>
					<th>供应商</th>
					<th>原仓库</th>
					<th width="50">发料人</th>
					<th width="80">调入库房</th>
					<th>收料人</th>
					<th width="70">操作</th>
				</tr>
			</thead>
			<tbody>
				<foreach name='list' item='v' key='k'>					
					<if condition="$v['type'] eq 1">
							<tr target="sid_goods" rel="{$v['id']}"><td>
							<input name="ids" value="{$v['id']}" type="checkbox">
					<else/>
						<tr target="sid_goods" rel=""><td>
					</if>
					</td>
					<td>{$v['sequence']}</td>
					<td>{$v['date']|date='Y-m-d',###}</td>
					<td>{$v['code']}</td>
					<td>{$v['new_code']}</td>
					<td>{$v['goods_name']}</td>
					<td>{$v['xinghao']}</td>
					<td>{$v['guige']}</td>
					<td>{$v['unit']}</td>
					<td>{$v['number']}</td>
					<td>{$v['price']}</td>
					<td>{$v['supplier_name']}</td>
					<td>{$v['depot_name']}</td>
					<td>{$v['sender']}</td>
					<td>{$v['new_depot_name']}</td>
					<td>{$v['receive']}</td>
					<td>
						<if condition="$v['type'] eq 0"><span style="color:red;">已拒绝<span></if>
						<if condition="$v['type'] eq 1">
							<in name="allot_refuseId" value="$Think.session.rules">
								<a title="拒绝该条物料调入指定库房？" target="ajaxTodo" href="{:U(MODULE_NAME.'/'.CONTROLLER_NAME.'/refuse','','')}/id/{$v['id']}/navTabId/allotIn" class="btnDel">拒绝调入</a>
							</in>
							<in name="allot_receiveId" value="$Think.session.rules">
								<a title="允许调入" target="ajaxTodo" href="{:U(MODULE_NAME.'/'.CONTROLLER_NAME.'/receive','','')}/id/{$v['id']}/navTabId/allotIn" class="btnSelect">允许调入</a>
							</in>
						</if>
						<if condition="$v['type'] eq 2"><span style="color:green;">已接收<span></if>
					</td>
				</tr>
				</foreach>
			</tbody>
		</table>
		<div class="panelBar">
			<div class="pages">
				<span>显示</span>
				<select class="combox" name="numPerPage" onchange="navTabPageBreak({$Think.config.TMPL_L_DELIM}numPerPage:this.value{$Think.config.TMPL_R_DELIM})">
					<option value="10" <if condition="$numPerPage eq 10">selected</if>>10</option>
					<option value="20" <if condition="$numPerPage eq 20">selected</if>>20</option>
					<option value="50" <if condition="$numPerPage eq 50">selected</if>>50</option>
					<option value="100" <if condition="$numPerPage eq 100">selected</if>>100</option>
				</select>
				<span>条，共{$totalCount}条</span>
			</div>
			<div class="pagination" targetType="navTab" totalCount="{$totalCount}" numPerPage="{$numPerPage}" pageNumShown="{$pageNumShown}" currentPage="{$currentPage}">
			</div>
		</div>
	</div>
</div>